package com.vincent.kdp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;

import com.vincent.kdp.ui.fragment.NewChildFragment;

import java.util.ArrayList;

/**
 * Created by jingjing on 2017/4/17.
 */

public class NewChildPagerAdapter extends FragmentPagerAdapter {

    private ArrayList<NewChildFragment> mChildFragments;

    public NewChildPagerAdapter(FragmentManager fm,ArrayList<NewChildFragment> mChildFragments) {
        super(fm);
        this.mChildFragments=mChildFragments;
    }

    @Override
    public int getCount() {
        return mChildFragments.size();
    }

    @Override
    public Fragment getItem(int position) {

        return mChildFragments.get(position);
    }


    @Override
    public CharSequence getPageTitle(int position) {
        return mChildFragments.get(position).getArguments().getString("childFragment");
    }
}
